package com.asiainfo.iam.controller;


import com.asiainfo.iam.service.DMDatabaseConnService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

@RestController
public class DMDatabaseController {
    private static final Logger log = LoggerFactory.getLogger(DMDatabaseController.class);


    @Autowired
    private DMDatabaseConnService dmDatabaseConnService;


    /**
     * 创建数据库连接
     * @param host
     * @param port
     * @param user
     * @param password
     * @return
     */
    public Connection createConn(String host, String port, String user, String password){
       return dmDatabaseConnService.createConn(host, port, user, password);
    }
}
